/*

package com.qm.console.component.amqp;

import com.alibaba.fastjson.JSON;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.AmqpException;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;


*/
/**
 * @author chenlei
 * @date 2018/1/5
 *//*


@Component
public class AmqpClient {
    private final Logger logger = LoggerFactory.getLogger(this.getClass());


    */
/**
     * amqp template
     *//*


    private final AmqpTemplate amqpTemplate;

    @Autowired
    public AmqpClient(AmqpTemplate amqpTemplate) {
        this.amqpTemplate = amqpTemplate;
    }


    */
/**
     * send message to match exchange
     *
     * @param message
     *//*


*/
/*    public boolean sendMessageToMatchExchange(Object message) {
        return sendMessageToExchange(AmqpConstant.weChat_REGISTER, message);
    }*//*



    */
/**
     * 发送微信用户注册消息给微信小程序队列
     *
     * @param message
     * @return
     *//*


   */
/* public boolean sendMessageToLotteryWithdrawExchange(String message) {
        return sendMessageToExchange(AmqpConstant.LOTTERY_WITHDRAW_NAME, message);

    }*//*



    */
/**
     * send message to exchange
     *
     * @param exchangeName
     * @param message
     *//*


    @Async
    public void sendMessageToExchange(String message) {

        try {
            // byte[] bytes = getBytesFromObject(message);
            amqpTemplate.convertAndSend(AmqpConstant.FanoutExchange_register_Exchange, AmqpConstant.weChat_REGISTER, JSON.toJSONString(message));
            logger.info("success to send amqp message, exchange name:{}, message:{}", AmqpConstant.weChat_REGISTER, JSON.toJSONString(message));
        } catch (AmqpException e) {
            logger.error("Failed to send amqp message, exchange name:{}, message:{}", AmqpConstant.weChat_REGISTER, JSON.toJSONString(message));
            return;
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

*/
/*    public byte[] getBytesFromObject(Serializable obj) throws Exception {
        if (obj == null) {
            return null;
        }
        ByteArrayOutputStream bo = new ByteArrayOutputStream();
        ObjectOutputStream oo = new ObjectOutputStream(bo);
        oo.writeObject(obj);
        return bo.toByteArray();
    }*//*



}

*/
